Component({
  properties: {
    item: {
      type: Object,
      value: {}
    }
  },
  data: {},
  methods: {
    decrement() {
      this.triggerEvent('decrement', {
        item: this.properties.item
      })
    },

    increment() {
      this.triggerEvent('increment', {
        item: this.properties.item
      })
    },

    changeQuantity(e) {
      const item = e.currentTarget.dataset.item
      const quantity =  parseInt(e.detail.value)
      // console.log(item, quantity)

      this.triggerEvent('changeQuantity', {
        item,
        quantity
      })
    }

  }
});
